#include "KeyboardDialog.h"
#include "ui_KeyboardDialog.h"
#include <QDebug>

KeyboardDialog::KeyboardDialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::KeyboardDialog)
{
    ui->setupUi(this);
}

KeyboardDialog::~KeyboardDialog()
{
    delete ui;
}

//按键按下执行
void KeyboardDialog::keyPressEvent (QKeyEvent *event)
{
    qDebug()<< "按键按下, 文本:" << event->text();
    qDebug("按键键值:%d", event->key());
}
//按键抬起执行
void KeyboardDialog::keyReleaseEvent (QKeyEvent *event)
{
    qDebug()<< "按键按下, 文本:" << event->text();
    qDebug("按键键值:%d", event->key());
}
